﻿using EP.Base.BaseService.Manager.Interface.Business;
using EP.Base.BaseService.Manager.Interface.Common;
using Quartz;

namespace EP.Base.BaseService.Manager.Business.QzJob
{
    /// <summary>
    /// 执行单个任务
    /// </summary>
    public class EsMaintainSingleTaskQzJob:IJob
    {
        public void Execute(IJobExecutionContext context)
        {
            var esMaintainTask = (IEsMaintainTask)context.MergedJobDataMap.Get("IEsMaintainTask");
            var serviceSimplifyLog = (IServiceSimplifyLog)context.MergedJobDataMap.Get("IServiceSimplifyLog");
            var esTaskConfigId = (int)context.MergedJobDataMap.Get("EsTaskConfigId");
            serviceSimplifyLog.ExecSl("执行任务-esTaskConfigId=" + esTaskConfigId, () => esMaintainTask.ExecSingleTask(esTaskConfigId));
        }
    }
}
